package com.ww.microrpc.netty.protocol;

import com.ww.microrpc.netty.Constant;

import java.io.Serializable;

/**
 * @author iiwan
 */
public interface Message extends Serializable {

    /**
     * message type: ping、pong、rpc-request、rpc-response
     * @return MessageType
     */
    int getMessageType();

    /**
     * mapping to response by requestId
     * @return RequestId
     */
    int getRequestId();

    /**
     * @return serializer type:
     */
    default int getSerializerType() { return Constant.SERIALIZER_DEFAULT; }
    default int getVersion() { return 1; }
    default int getField1() { return 1; }


}
